package com.hollycrm.sdk.wsclient;

import java.lang.reflect.Type;

import org.springframework.messaging.simp.stomp.StompFrameHandler;
import org.springframework.messaging.simp.stomp.StompHeaders;
import org.springframework.messaging.simp.stomp.StompSession;
import org.springframework.messaging.simp.stomp.StompSessionHandlerAdapter;

public class StompSessionHandler  extends StompSessionHandlerAdapter {

	@Override
	public void handleFrame(StompHeaders headers, Object payload) {
		super.handleFrame(headers, payload);
	}

	public void afterConnected(StompSession session,
			StompHeaders connectedHeaders) {
		session.subscribe("/topic/liantong.wechat.wx10010.wanghui",
				new StompFrameHandler() {

					@Override
					public void handleFrame(StompHeaders headers,
							Object payload) {
						System.out.println("recv msg :" +payload);
					}

					@Override
					public Type getPayloadType(StompHeaders headers) {
						return String.class;
					}
				});
		
	}

}
